//
//  HeaderView.m
//  BrushFace
//
//  Created by timer_q on 15/12/7.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import "HeaderView.h"

@implementation HeaderView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (void)addDataWithQuestionArray:(NSArray *)questionArr{
    if (questionArr.count>0) {
        _questionLabel.text = [questionArr objectAtIndex:0];
        for (int i=1; i<questionArr.count; i++) {
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(_questionLabel.frame.origin.x, _questionLabel.frame.origin.y+_questionLabel.frame.size.height*i, _questionLabel.frame.size.width, _questionLabel.frame.size.height)];
            label.text = [questionArr objectAtIndex:i];
            label.font = _questionLabel.font;
            label.textColor = [UIColor darkGrayColor];
            [self addSubview:label];
        }
    }
}
- (IBAction)questionButtonClick:(id)sender {
    _action(_row);
}

- (void)addAction:(HeaderViewClick)action{
    _action = action;
}

@end
